package day02;

/**
 * Created by Shinelon on 2016/9/10.
 */
public class Homework {
    public static void main(String[] args) {
        Homework homework = new Homework();
        //System.out.println(homework.getMaxAge());
        int[] result = homework.sort();
        for (int i = 0; i < result.length; i++) {
            System.out.println(result[i]);
        }
    }

    /**
     * 稍加改造，要求把数组内容从小到大排列显示出来
     * @return
     */
    public int[] sort() {
        //1.
        int[] ages ={18 ,23 ,21 ,19 ,25 ,29 ,17};

        //code 这里写排序，允许你百度



        return ages;
    }


    public int getMaxAge() {
        //1.
        int[] ages ={18 ,23 ,21 ,19 ,25 ,29 ,17};
        //2.
        int max = ages[0];
        //3.
        for (int i = 1; i <ages.length ; i++) {
            if (ages[i] > max) {
                max = ages[i];
            }
        }
        return max;
    }

}


